#include "thread.h"
#include "utils.h"

pthread_t createThread(void *func, void *arg)
{
    pthread_t tid;
    if (pthread_create(&tid, NULL, func, arg) != 0)
    {
        PRINT_ERROR("pthread_create");
        return -1;
    }
    return tid;
}

int threadJoin(pthread_t tid)
{
    if (pthread_join(tid, NULL) != 0)
    {
        PRINT_ERROR("pthread_join");
        return -1;
    }
    return 0;
}

